<?php

// $Id$

require_once(TANGRA_MAIN_DIR.'form/fields/text/form_field_text_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/fields/integer_positive/form_field_integer_positive_view.class.php');
require_once(TANGRA_MAIN_DIR.'form/guardable_form_view.class.php');


class Settings_Attachments_Form_View extends Guardable_Form_View {
	function __construct(Form &$form) {
		parent::__construct($form);

		$f_max_size = $form->get_field('max_size');
		$f_max_size_view = new Form_Field_Integer_Positive_View($form->get_name().'_'.$f_max_size->get_name(), $f_max_size);
		$this->add_field_view('max_size', $f_max_size_view);

		$f_max_total_size = $form->get_field('max_total_size');
		$f_max_total_size_view = new Form_Field_Integer_Positive_View($form->get_name().'_'.$f_max_total_size->get_name(), $f_max_total_size);
		$this->add_field_view('max_total_size', $f_max_total_size_view);

		$f_forbidden_extensions = $form->get_field('forbidden_extensions');
		$f_forbidden_extensions_view = new Form_Field_Text_View($form->get_name().'_'.$f_forbidden_extensions->get_name(), $f_forbidden_extensions);
		$this->add_field_view('forbidden_extensions', $f_forbidden_extensions_view);

		$f_upload_path = $form->get_field('upload_path');
		$f_upload_path_view = new Form_Field_Text_View($form->get_name().'_'.$f_upload_path->get_name(), $f_upload_path);
		$this->add_field_view('upload_path', $f_upload_path_view);
	}
}
